package zx.x.modules.yshapp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import zx.x.common.utils.PageUtils;
import zx.x.common.utils.Query;
import zx.x.modules.yshapp.dao.CommunityBulletinAppDao;
import zx.x.modules.yshapp.entity.CommunityBulletinEntity;
import zx.x.modules.yshapp.service.CommunityBulletinService;

import java.util.Map;


@Service("communityBulletinAppService")
public class CommunityBulletinAppServiceImpl extends ServiceImpl<CommunityBulletinAppDao, CommunityBulletinEntity> implements CommunityBulletinService {
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<CommunityBulletinEntity> page = this.page(
                new Query<CommunityBulletinEntity>().getPage(params),
                new QueryWrapper<CommunityBulletinEntity>().eq("community_id", params.get("communityId"))
                        .eq("delete_flag", 0)
                        .orderBy(true,false,"cj_time")
        );

        return new PageUtils(page);
    }
}